﻿using System;
using System.Windows.Forms;

namespace VideoMergeSplitApp.ui.dialog
{
    public partial class InputDialogBox1 : Form
    {
        public int res = 0;
        public InputDialogBox1()
        {
            InitializeComponent();
        }

        private void InputDialogBox1_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                res = int.Parse(textBox1.Text);
                Close();
            }
            catch (Exception)
            {
                return;
            }
        }


        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (!char.IsDigit(e.KeyChar) && e.KeyChar != '\b') // 判断按键是否为数字或退格键
            {
                e.Handled = true; // 阻止字符的输入
            }
        }
    }
}
